import java.util.Scanner;

public class Main {
   public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int num,cout,spday;
        num = (int)(Math.sqrt(k*2+0.25) - 0.5);
        spday = k - num*(num+1)/2;
        cout = num*(num+1)*(2*num+1)/6 + spday*(num+1);
        System.out.println(cout) ;
    } 
}